﻿<?php

class vCustomer
{
	public static function Generate($jobs, $show_actions)
	{
		
		$xtpl = new XTemplate('xtpl/customers.xtpl');
		if($show_actions)
		{
			$xtpl->parse('root.table.actions');
		}

		foreach ($jobs as $job) {
			$xtpl->assign('id', $job['id']);
			$xtpl->assign('title', $job['title']);
			$xtpl->assign('contacts', $job['contacts']);
			$xtpl->assign('addr', $job['addr']);
			$xtpl->parse('root.table.row');
		}
		$xtpl->parse('root.table');
		$xtpl->parse('root.dlg');
		return $xtpl->text('root.table').$xtpl->text('root.dlg');
	}

}